package com.jianan.mis.sys;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;

public class ImageManager {

	public static ImageDescriptor getImageDescriptor(String imagePath) {
		return getPluginImageDescriptor(IAppConstants.APPLICATION_ID, imagePath);
	}

	public static ImageDescriptor getPluginImageDescriptor(String pluginId,
			String imagePath) {
		return AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, imagePath);
	}

	public static Image getImage(String imagePath) {
		return getPluginImage(IAppConstants.APPLICATION_ID, imagePath);
	}

	public static Image getPluginImage(String pluginId, String imagePath) {
		return ResourceManager.getImage(AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, imagePath));
	}
}
